package com.uday.kraterchat.chatclient.model
{
	import com.adobe.cairngorm.model.IModelLocator;
	import com.uday.kraterchat.chatclient.data.UserInfoDetItem;
	import com.uday.kraterchat.chatclient.util.ChatClientConstants;
	import com.uday.kraterchat.chatclient.view.ChatWindow;
	
	import flash.utils.Dictionary;
	import flash.utils.Timer;
	
	import mx.collections.ArrayCollection;
	
	[Bindable]
	public class ChatClientModel implements IModelLocator
	{
		private static var modelLocator :ChatClientModel;
		
		public static function getInstance():ChatClientModel 
		{
			if ( modelLocator == null )
				modelLocator = new ChatClientModel();
				
			return modelLocator;
		}
	   
	   	public function ChatClientModel() 
	   	{
	   		if ( ChatClientModel.modelLocator != null )
					throw new Error( "Only one ModelLocator instance should be instantiated" );
	   	}
	   	
	   	public var objCurrUser:UserInfoDetItem;
	   	public var mainAppState:String = KraterChatAir.STATE_LOGIN;
	   	public var loginPageState:String = null;
	   	public var strRecvdMessages:String = "";
	   	public var currChatWin:Dictionary = new Dictionary();
	   	
	   	public var lstFriends:ArrayCollection = new ArrayCollection();
	   	
	   	public var objKeepAliveTimer:Timer = new Timer(ChatClientConstants.KEEP_ALIVE_FREQ);
	   	
	   	public var blnIsMinimized:Boolean = false;
	   	
	   	public var objChatWindow:ChatWindow = new ChatWindow();
	   	public var blnIsApplClosed:Boolean = false;
	}
}